package br.ufpe.cin.rdfilter.model;

import java.io.Serializable;
import javax.persistence.*;

import java.math.BigDecimal;


/**
 * The persistent class for the similarity database table.
 * 
 */
@Entity
@Table(name="similarity")
@NamedQueries({
	@NamedQuery(name = "Similarity.findAll", query = "SELECT sim FROM Similarity sim")
})
public class Similarity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="id_similarity_seq", sequenceName="id_similarity_seq", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_similarity_seq")
	@Column(unique=true, nullable=false)
	private Integer id;

	@Column(precision=3, scale=2)
	private Double measure;

	//bi-directional many-to-one association to User
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="user2")
	private User user1Bean;

	//bi-directional many-to-one association to User
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="user1")
	private User user2Bean;

	public Similarity() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Double getMeasure() {
		return this.measure;
	}

	public void setMeasure(Double measure) {
		this.measure = measure;
	}

	public User getUser1Bean() {
		return this.user1Bean;
	}

	public void setUser1Bean(User user1Bean) {
		this.user1Bean = user1Bean;
	}

	public User getUser2Bean() {
		return this.user2Bean;
	}

	public void setUser2Bean(User user2Bean) {
		this.user2Bean = user2Bean;
	}

}